﻿using System.Net.Sockets;
using System.Text;

namespace Mailias.UI.Web
{
    public class StateObject
    {
        // Client  socket.
        public Socket workSocket = null;
        // Size of receive buffer.
        public const int BufferSize = 1024;
        // Receive buffer.
        public byte[] buffer = new byte[BufferSize];
        // Received data string.
        public StringBuilder sb = new StringBuilder();

        //Server Name
        public string ServerName{ get; set; }

        public object DocumentStore { get; set; }

        public Message MailMessage { get; set; }

        public bool ExpectEoD { get; set; }
        public bool CouldBeHeader { get; set; }

        public ConversationSteps NextStepInConversation;

        public enum ConversationSteps
        {
            HELO,
            MAILFrom,
            RCPTTo,
            DATA,
            EoD,
            QUIT
        }

        public StateObject()
        {
            MailMessage = new Message();
        }
    }
}
